<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="${pageContext.request.contextPath}/styly.css" type="text/css" rel="stylesheet"/>
        <title><spring:message code="employeeedit.title"/></title>
    </head>
    <body>
        <div class="wrapper">
            <div class="header"><h1> <spring:message code="employeeedit.header"/></h1></div>
            <div class="navig">
                <%@ include file="../navig.jsp" %>
            </div>

            <div class="content">
                <h3><spring:message code="employeeedit.contentheader"/></h3>    
                <form method="post" action="../employeeEdit">
                    <div style="color: red;">
                        <spring:message code="${editerrMessage1}"/>
                        <spring:message code="${editerrMessage2}"/>
                        <spring:message code="${editerrMessage3}"/>
                        <spring:message code="${editerrMessage4}"/>
                        <spring:message code="${editerrMessage5}"/>
                    </div>
                    <input type="hidden" name="id" value="${employee.id}"/>
                    <b><spring:message code="employeeedit.meno"/></b><input type="text" size="20" name="name" value="${employee.name}"/><br/>
                    <b><spring:message code="employeeedit.priezvisko"/></b><input type="text" size="30" name="surname" value="${employee.surname}"/><br/>
                    <b><spring:message code="employeeedit.datumnarodenia"/></b> <input type="text" name="date" value="${employee.birthDate}"/><br/>
                    <b><spring:message code="employeelist.username"/></b><input type="text" size="30" name="username" value="${employee.username}"/><br/>
                    <b><spring:message code="employeelist.password"/></b><input type="text" size="30" name="password" value="${employee.password}"/><br/>
                    <b><spring:message code="employeeedit.spolocnost"/></b> <select name="input4">
                        <c:forEach items="${companies}" var="company" >
                            <option value="${company.id}">${company.name}</option>
                        </c:forEach>
                    </select><br/>
                    <b><spring:message code="employeelist.authority"/></b><select name="authority">
                            <option value="1"><spring:message code="employeelist.user"/></option>
                            <option value="2"><spring:message code="employeelist.admin"/></option>
                    </select><br/>
                    <b><spring:message code="employeelist.enabled"/></b><select name="enabled">
                            <option value="1"><spring:message code="employeelist.yes"/></option>
                            <option value="2"><spring:message code="employeelist.no"/></option>
                    </select><br/>
                    <input type="submit" name="submit" value="<spring:message code="employeeedit.upravit"/>" />
                    <input type="button" name="button" value="<spring:message code="employeeedit.spat"/>" onCLick="history.back()" />
                </form>
            </div>
            <div class="footer">
                Team: Andrej Hraško, Ondřej Myška, Lukáš Slovák, Michal Polkoráb
            </div>
        </div>        
    </body>
</html>